﻿<UserControl x:Class="Framework.UI.TestHarness.Views.ValidationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:params="http://schemas.codeplex.com/elysium/params"
             xmlns:extra="http://schemas.extra.com/ui"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <TextBlock Grid.ColumnSpan="2" 
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Style="{StaticResource HeaderTextStyle}" 
                       Text="Default Validation Style"/>

            <!--<Label Grid.Row="1"
                   Content="CheckBox Default Validation"
                   Target="{Binding ElementName=CheckBox1}"/>
            <CheckBox x:Name="CheckBox1" 
                      Grid.Column="1"
                      Grid.Row="1"
                      IsChecked="{Binding Path=Boolean, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
                      Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                      VerticalAlignment="Stretch"/>-->

            <Label Grid.Row="1"
                   Content="ComboBox Default Validation"
                   Target="{Binding ElementName=TextBox1}"/>
            <ComboBox x:Name="ComboBox1" 
                      Grid.Column="1"
                      Grid.Row="1"
                      ItemsSource="{Binding Items}"
                      Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                      SelectedItem="{Binding Path=SelectedItem, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"/>
            
            <Label Grid.Row="2"
                   Content="TextBox Default Validation"
                   Target="{Binding ElementName=TextBox1}"/>
            <TextBox x:Name="TextBox1" 
                     Grid.Column="1"
                     Grid.Row="2"
                     Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                     Text="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"/>

            <Label Grid.Row="3"
                   Content="IntegerUpDown Default Validation"
                   Target="{Binding ElementName=IntegerUpDown1}"/>
            <extra:IntegerUpDown x:Name="IntegerUpDown1" 
                               Grid.Column="1"
                               Grid.Row="3"
                               Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                               Value="{Binding Path=Number, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"/>

            <Label Grid.Row="4"
                   Content="DatePicker Default Validation"
                   Target="{Binding ElementName=DatePicker1}"/>
            <DatePicker x:Name="DatePicker1" 
                        Grid.Column="1"
                        Grid.Row="4"
                        Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                        SelectedDate="{Binding Path=DateTime, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"/>

            <TextBlock Grid.ColumnSpan="2" 
                       Grid.Row="5"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Style="{StaticResource HeaderTextStyle}" 
                       Text="Tick and Warning ValidationContentControl"/>

            <!--<Label Grid.Row="6"
                   Content="CheckBox ValidationContentControl"
                   Target="{Binding ElementName=CheckBox2}"/>
            <ContentControl Grid.Column="1"
                            Grid.Row="6"
                            Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                            Style="{StaticResource ValidationContentControl}">
                <CheckBox x:Name="CheckBox2" 
                          IsChecked="{Binding Path=Boolean, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
                          VerticalAlignment="Stretch"/>
            </ContentControl>-->

            <Label Grid.Row="6"
                   Content="ComboBox Default Validation"
                   Target="{Binding ElementName=TextBox2}"/>
            <ContentControl Grid.Column="1"
                            Grid.Row="6"
                            Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                            Style="{StaticResource ValidationContentControl}">
                <ComboBox x:Name="ComboBox2" 
                          ItemsSource="{Binding Items}"
                          SelectedItem="{Binding Path=SelectedItem, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"/>
            </ContentControl>
            
            <Label Grid.Row="7"
                   Content="TextBox ValidationContentControl"
                   Target="{Binding ElementName=TextBox2}"/>
            <ContentControl Grid.Column="1"
                            Grid.Row="7"
                            Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                            Style="{StaticResource ValidationContentControl}">
                <TextBox x:Name="TextBox2" 
                         Text="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"/>
            </ContentControl>

            <Label Grid.Row="8"
                   Content="IntegerUpDown ValidationContentControl"
                   Target="{Binding ElementName=IntegerUpDown2}"/>
            <ContentControl Grid.Column="1"
                            Grid.Row="8"
                            Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                            Style="{StaticResource ValidationContentControl}">
                <extra:IntegerUpDown x:Name="IntegerUpDown2" 
                                     Value="{Binding Path=Number, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"/>
            </ContentControl>

            <Label Grid.Row="9"
                   Content="DatePicker ValidationContentControl"
                   Target="{Binding ElementName=DatePicker2}"/>
            <ContentControl Grid.Column="1"
                            Grid.Row="9"
                            Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                            Style="{StaticResource ValidationContentControl}">
                <DatePicker x:Name="DatePicker2" 
                            SelectedDate="{Binding Path=DateTime, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"/>
            </ContentControl>

            <TextBlock Grid.ColumnSpan="2" 
                       Grid.Row="10"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Style="{StaticResource HeaderTextStyle}" 
                       Text="DataGrid Validation"/>

            <TextBlock Grid.ColumnSpan="2" 
                       Grid.Row="11"
                       Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                       Style="{StaticResource NormalTextStyle}" 
                       Text="Click DataGrid tab for a full example of a DataGrid with invalid records."/>

        </Grid>
    </Grid>
</UserControl>
